//
//  BKPlayerView.h
//  XPhoto
//
//  Created by sentinel on 2020/3/23.
//  Copyright © 2020 baboy. All rights reserved.
//

#import <BKKit/BKKit.h>
#import <AVFoundation/AVFoundation.h>
#import <BKKit/BKView.h>
typedef NS_ENUM(NSInteger, BKPlayerPlayMode) {
    BKPlayerPlayModeDefault          = 0,
    BKPlayerPlayModeSingleLoop     = 1
};

NS_ASSUME_NONNULL_BEGIN

@interface BKPlayerView : BKView
@property(nonatomic, strong) AVPlayer *player;
@property(nonatomic, strong) AVPlayerItem *playerItem;
@property(nonatomic, strong) UIImage *coverImage;
@property(nonatomic, strong) NSURL *coverURL;
@property(nonatomic, strong) NSURL *videoURL;
@property(nonatomic, strong) AVURLAsset *videoURLAsset;
@property(nonatomic, strong) IBOutlet UIView *coverView;
@property(nonatomic, strong) IBOutlet UIImageView *coverImageView;
@property(nonatomic, strong) IBOutlet UIView *controlView;
@property(nonatomic, strong) IBOutlet UIButton *bigPlayButton;
@property(nonatomic, strong) IBOutlet UIButton *playButton;
@property(nonatomic, strong) IBOutlet UISlider *slider;
@property(nonatomic, strong) IBOutlet UIProgressView *progressView;
@property(nonatomic, strong) IBOutlet UILabel *timeLabel;
@property(nonatomic, assign) BOOL shouldAutoPlay;
@property(nonatomic, assign) BOOL showControls;
@property(nonatomic, assign) CGFloat duration;
@property(nonatomic, assign) BKPlayerPlayMode playMode;

- (void)play;
- (void)pause;
- (void)stop;

+ (BKPlayerView*)view;
@end

NS_ASSUME_NONNULL_END
